package org.tony.sim.fmt;

public abstract class Instruction {
    public final Module module;   // 指令所属模块
    public final Category category; // 指令类别
    public final String name;     // 指令名称
    public final String description;  // 指令描述

    protected Instruction(Module module, Category category, String name, String description) {
        this.module = module;
        this.category = category;
        this.name = name;
        this.description = description;
    }

    @Override
    public String toString() {
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append("{\"module\":\"").append(module)
                .append("\", \"category\":\"").append(category)
                .append("\", \"name\":\"").append(name)
                .append("\", \"description\":\"").append(description).append("\"}");

        return stringBuilder.toString();
    }
}
